package ncu.me.musicplayer.player;

import android.media.MediaDataSource;

import java.io.IOException;

/**
 * @Author ye
 * @Date 2020/6/1 20:55
 * @Version 1.0
 */
public interface IPlayer {
    void play(String filePath);
    void stop();
    void resume();
    void pause();
    void seek(int pos);
    default void seek(float percentage){
        seek(size()*percentage);
    }
    int size();
    int pos();
    boolean isPlaying();
    void setOnFinishedListener(OnPlayFinishedListener listener);

    interface OnPlayFinishedListener{
        void onFinish();
    }


}
